package com.tm.d14_method_references;
/**
 *2024/5/25 Cjj Book 构造器引用 19:28
 */
public class BookTest {
    public static void main(String[] args) {
   /*    CreateBook b=  new CreateBook(){

             @Override
             public Book create(String name, double price, String people) {
                 return new Book(name,price,people);
             }
         };
        System.out.println(b.create("日记",22.3,"小明").toString());*/

       // CreateBook b= (name,price,people)->new Book(name,price,people);

        CreateBook book = Book::new;
        Book b = book.create("日记", 44.6, "王五");
        System.out.println(b.toString());


    }

interface  CreateBook{
    Book create(String name,double price,String people);
}
}